-- Created by Bob Bockholt, Humanities Research Center, BYU
-- (everything written by Bob is named "doit")
on doit
global total
if total < the number of card buttons then
set the hilite of the target to not the hilite of the target
put the number of target into k
if the hilite of target then add k to k
put 1 + (k mod the number of card buttons) into k
set the hilite of button k to not the hilite of button k
if the number of the target is not k then
if the hilite of target
then add one to total
else subtract one from total
if the hilite of button k
then add one to total
else subtract one from total
end if
if total = the number of card buttons then win
else if cd fld score <= 0 then lose
else subtract 10 from cd fld score
else
play boing
end if
end doit
on win
hide cd fld lose
rightSound
end win
on lose
wrongSound
end lose
on closeCard
global total
lock screen
show cd fld lose
put zero into total
put 100 into cd fld score
repeat with i = 1 to the number of card buttons
set the hilite of card button i to false
end repeat
pass closeCard
end closeCard
-- part 1 (button)
-- low flags: 00
-- high flags: 8005
-- rect: left=63 top=158 right=177 bottom=136
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: One
----- HyperTalk script -----
on mouseUp
doit
end mouseUp
-- part 2 (button)
-- low flags: 00
-- high flags: 8005
-- rect: left=63 top=177 right=196 bottom=136
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Two
----- HyperTalk script -----
on mouseUp
doit
end mouseUp
-- part 3 (button)
-- low flags: 00
-- high flags: 8005
-- rect: left=63 top=196 right=215 bottom=136
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Three
----- HyperTalk script -----
on mouseUp
doit
end mouseUp
-- part 4 (button)
-- low flags: 00
-- high flags: 8005
-- rect: left=63 top=215 right=234 bottom=136
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Four
----- HyperTalk script -----
on mouseUp
doit
end mouseUp
-- part 5 (button)
-- low flags: 00
-- high flags: 8005
-- rect: left=63 top=234 right=253 bottom=136
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Five
----- HyperTalk script -----
on mouseUp
doit
end mouseUp
-- part 6 (button)
-- low flags: 00
-- high flags: 8005
-- rect: left=63 top=253 right=272 bottom=136
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Six
----- HyperTalk script -----
on mouseUp
doit
end mouseUp
-- part 7 (button)
-- low flags: 00
-- high flags: 8005
-- rect: left=63 top=272 right=291 bottom=136
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Seven
----- HyperTalk script -----
on mouseUp
doit
end mouseUp
-- part 9 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=20 top=56 right=153 bottom=503
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
-- part 10 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=245 top=199 right=216 bottom=303
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
-- part 11 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=251 top=220 right=247 bottom=290
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 3
-- text size: 14
-- style flags: 256
-- line height: 18
-- part name: score
-- part 13 (field)
-- low flags: 01
-- high flags: 0001
-- rect: left=337 top=190 right=264 bottom=477
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: lose
-- part 15 (button)
-- low flags: 00
-- high flags: 8005
-- rect: left=63 top=291 right=310 bottom=136
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Eight
----- HyperTalk script -----
on mouseUp
doit
end mouseUp
-- part 16 (field)
-- low flags: 81
-- high flags: 2004
-- rect: left=134 top=146 right=260 bottom=374
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Info
----- HyperTalk script -----
on mouseUp
info
end mouseUp
-- part 17 (button)
-- low flags: 00
-- high flags: 2001
-- rect: left=490 top=320 right=342 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 26635 / 26635
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
info
end mouseUp
-- part contents for card part 9
----- text -----
Your assignment, should you choose to accept it, is to get an 'X' in all of the boxes below. Although this may sound simple, you will quickly be convinced otherwise. Your success will depend on recognizing a pattern in the operation of the buttons. Your score will depend on the number of clicks it takes you to get all the X's.
Good luck!
-- part contents for card part 10
----- text -----
Score:
-- part contents for card part 11
----- text -----
100
-- part contents for card part 16
----- text -----
A colleague of mine put this in here. It doesn't really demonstrate anything, but I left it in for sentimental reasons.